import request from '~/utils/request'

export function getOrderByUserId(uid, query) {
  return request({
    url: '/order/portalOrder/list',
    method: 'get',
    params: {
      'uid': uid,
      'status': -1,
      pageNum: query.page,
      pageSize: query.size
    }
  })
}

export function generateOrder(data) {
  return request({
    url: '/order/portalOrder/generateOrder',
    method: 'post',
    data
  })
}

export function deleteOrder(orderSn) {
  return request({
    url: `/order/order/delete?ids=${orderSn}`,
    method: 'post'
  })
}

export function paySuccess(orderId) {
  return request({
    // 支付方式写死为1
    url: `/order/portalOrder/paySuccess?orderId=${orderId}&payType=1`,
    method: 'post'
  })
}

